package com.li.system.controller.user;


import com.li.common.core.controller.BaseController;
import com.li.common.core.domain.R;
import com.li.common.core.domain.TableDataInfo;
import com.li.system.domain.user.dto.UserDTO;
import com.li.system.domain.user.dto.UserQueryDTO;
import com.li.system.service.user.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/user")
public class UserController extends BaseController {

    @Autowired
    private IUserService userService;

    // 用户列表
    @GetMapping("/list")
    public TableDataInfo list(UserQueryDTO userQueryDTO) {
        return getTableDataInfo(userService.list(userQueryDTO));
    }

    //修改用户状态
    @PutMapping("/updateStatus")
    public R<Void> updateStatus(@RequestBody UserDTO userDTO){
        return toR(userService.updateStatus(userDTO));
    }


}
